package deom1;


class Score<T> {
    public Object[] array = new Object[10];

    public T getPos(int pos) {
        return (T) this.array[pos];
    }

    public void setPos(int pos,T val) {
        this.array[pos] = val;
    }
}

public class StudentScore {
    public static void main(String[] args) {
        //指定泛型的类型为整型
        Score<Integer> score = new Score<>();
        score.setPos(0,90);
        score.setPos(1,70);
        score.setPos(2,90);
        System.out.println(score.getPos(2));
    }
}
